import numpy as np
import pandas as pd
import time
from os import walk
import openpyxl
import os
import re
import math
import shutil
import  openpyxl
from openpyxl.styles import PatternFill, Border, Side, Font, colors,Alignment
pd.set_option('display.max_columns', None)   #显示完整的列
pd.set_option('display.max_rows', None)  #显示完整的行

class CompanyInforCat:
    def __init__(self):
        self.FileCompany = '企业信息合并/企业总表删链接.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
        self.FileCompanyAll = '企业数据库/CSMAR/上市公司基本信息年度表220507693(仅供中国人民大学使用)/STK_LISTEDCOINFOANL.xlsx'  # 文件夹路径，替换为你的实际文件夹路径

    def Match(self,Company,CompanyAll,columnCount):
        # 使用 glob 模块匹配文件夹中的所有文本文件
        print(Company.shape,CompanyAll.shape)
        print(Company, CompanyAll)

        # 新增一列，所有元素为0
        new_column = np.full((Company.shape[0], columnCount),-0.2023)
        # 使用 np.hstack 连接矩阵和新列
        Company = np.hstack((Company, new_column))
        Company= Company.astype(object)

        print("匹配中")
        for i in range(len(Company)):
            if i%5000==0:
                print('i', i, len(Company),'len(CompanyAll)', len(CompanyAll))
            for j in range(len(CompanyAll)):
                if Company[i,0] == CompanyAll[j,0] and Company[i,1] == CompanyAll[j,1]:
                    #要匹配的所有列
                    for k in range(columnCount):
                        Company[i,2+k] = CompanyAll[j,2+k]
                    CompanyAll = np.delete(CompanyAll, j, axis=0)
                    break
        print("Company",Company)
        return Company
    def write_to_column(self,filename, column_letter,start_row, data_list):
        '''
        :param filename: 写入文件名字
        :param column_letter: 要写入的列
        :param start_row: 开始的行
        :param data_list:  待写入的数据,类型为list
        :return:
        '''
        # 打开已存在的xlsx文件
        workbook = openpyxl.load_workbook(filename)
        # 选择工作表
        sheet = workbook.active
        print("写入中")
        # 遍历数据并写入指定列
        for i, data in enumerate(data_list, start=start_row):
            if data!=-0.2023:
                sheet[f'{column_letter}{i}'] = data
                # print(i,data)
        # 保存修改后的xlsx文件
        workbook.save(filename)

    def write_to_matrix(self, filename1,filename2, start_column, start_row, data_matrix):
        '''
        :param filename: 写入文件名字
        :param column_letter: 要写入的列
        :param start_row: 开始的行
        :param data_list:  待写入的数据,类型为list
        :return:
        '''
        # 打开已存在的xlsx文件
        workbook = openpyxl.load_workbook(filename1)
        # 选择工作表
        sheet = workbook.active
        print("写入中")

        # 循环遍历二维矩阵的每个元素，写入到指定位置
        for row_index, row in enumerate(data_matrix, start=start_row):
            for col_index, value in enumerate(row, start=start_column):
                if value != -0.2023:
                    sheet.cell(row=row_index, column=col_index, value=value)

        # 保存修改后的xlsx文件
        workbook.save(filename2)

    def Read_data(self,filePath2,usecols,skiprows):   #
        dataFileCompany = pd.read_excel(self.FileCompany,\
                                  usecols=[0,1],\
                                        #,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
                                  skiprows=[0,1,2], \
                                  header=None)

        dataFileCompanyAll = pd.read_excel(filePath2, \
                                        usecols=usecols, \
                                        skiprows=skiprows, \
                                        #    skiprows=list(range(0000, 20001)),\
                                        header=None)
        dataFileCompanyAll=dataFileCompanyAll.where(dataFileCompanyAll.notnull(), 0)

        dataFileCompany = np.array(dataFileCompany)
        dataFileCompanyAll = np.array(dataFileCompanyAll)
        dataFileCompanyAll[:,1]=np.array([date[:4] for date in dataFileCompanyAll[:,1]])
        dataFileCompany=self.convert_column_to_int(dataFileCompany,0)
        dataFileCompanyAll = self.convert_column_to_int(dataFileCompanyAll,0)
        dataFileCompanyAll = self.convert_column_to_int(dataFileCompanyAll,1)
        return dataFileCompany, dataFileCompanyAll

    def Read_data_ChuangXinDaoXiang(self, filePath2, usecols, skiprows):  #
        dataFileCompany = pd.read_excel(self.FileCompany, \
                                        usecols=[0, 1], \
                                        # ,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
                                        skiprows=[0, 1, 2,3], \
                                        header=None)

        dataFileCompanyAll = pd.read_excel(filePath2, \
                                           usecols=usecols, \
                                           skiprows=skiprows, \
                                           #    skiprows=list(range(0000, 20001)),\
                                           header=None)
        dataFileCompanyAll = dataFileCompanyAll.where(dataFileCompanyAll.notnull(), -0.2023)

        dataFileCompany = np.array(dataFileCompany)

        dataFileCompanyAll = np.array(dataFileCompanyAll)
        dataFileCompany = self.convert_column_to_int(dataFileCompany, 0)
        dataFileCompanyAll = self.convert_column_to_int(dataFileCompanyAll, 0)
        dataFileCompanyAll = self.convert_column_to_int(dataFileCompanyAll, 1)

        # 交换第 0 列和第 1 列
        dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
        # 获取第一列的索引，用于排序矩阵
        sorting_indices = np.argsort(dataFileCompanyAll[:, 0])
        # 使用排序索引对矩阵进行排序
        dataFileCompanyAll = dataFileCompanyAll[sorting_indices, :]

        return dataFileCompany, dataFileCompanyAll

    def convert_column_to_int(self,matrix_array,i):
        # Step 1: Extract the first column as a string array
        first_column_str = matrix_array[:, i]

        # Step 2: Convert the string array to int array
        first_column_int = first_column_str.astype(int)

        # Step 3: Replace the first column in the original array with the int array
        matrix_array[:, i] = first_column_int

        return matrix_array

    def fillNameDelST(self, filePath, str):
        '''
        匹配全名，删除st
        :param filePath: 文件路径
        :param str: 删除企业名称中含str的企业
        :return:
        '''
        dataFileCompany = pd.read_excel(filePath, \
                                        usecols=[3], \
                                        # ,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
                                        skiprows=[0, 1, 2, 3], \
                                        header=None)

        dataFileCompany = np.array(dataFileCompany)
        print(dataFileCompany.shape,dataFileCompany)
        for i in range (len(dataFileCompany)):
            if pd.isna(dataFileCompany[i,0]):
                dataFileCompany[i, 0]=dataFileCompany[i-1,0]

        print("已补全", dataFileCompany)
        self.write_to_matrix(filePath, "企业信息合并/企业总表_已匹配_已补全名.xlsx", 4, 5, dataFileCompany)

if __name__ == "__main__":

    CompanyInforCat=CompanyInforCat()
    CompanyInforCat.fillNameDelST("企业信息合并/企业总表_已匹配.xlsx","st")


    #1 匹配全名
    # FileCompanyAll = '企业数据库/CSMAR/上市公司基本信息年度表220507693(仅供中国人民大学使用)/STK_LISTEDCOINFOANL.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll=CompanyInforCat.Read_data(FileCompanyAll, usecols=[0,2,9], skiprows=[0,1,2])
    # name=CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll)
    # CompanyInforCat.write_to_column('企业信息合并/企业总表删链接.xlsx','D',4,name)

    #2 [金山文档] 管理层数字创新导向指标表（年）145154101.zip
    # FileCompanyAll = '企业数据库/CSMAR/管理层数字创新导向指标表（年）145154101/EDT_ManagementDgtlInnInd.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll= CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll, usecols=[0,1,3,4,5,6], skiprows=[0, 1, 2])
    # # 交换第 0 列和第 1 列
    # dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll,4)
    #
    # columns = pd.read_excel(FileCompanyAll, \
    #                                 usecols=[0,1,3,4,5,6], \
    #                                 # ,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
    #                                 skiprows=list(range(3, 43293)), \
    #                                 header=None)
    # columns = np.array(columns)
    # columns = columns[1, :]
    # submission = pd.DataFrame(chuangXinDaoXiang, columns=columns)
    # submission.to_excel('企业信息合并/企业总表chuangXinDaoXiang.xlsx', index=True, sheet_name='Company')
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接.xlsx','企业信息合并/企业总表删链接chuangxin.xlsx',53,5,chuangXinDaoXiang[:,2:])

    #3 [金山文档] 管理层数字职务设立情况表（年）145036890.zip
    # FileCompanyAll = '企业数据库/CSMAR/管理层数字职务设立情况表（年）145036890/EDT_MDADigJobEstY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1, 3, 4, 5],
    #                                                                                   skiprows=[0, 1, 2])
    # # 交换第 0 列和第 1 列
    # dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 3)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接chuangxin.xlsx', '企业信息合并/企业总表删链接-1-2-3.xlsx', 57,
    #                                 5, chuangXinDaoXiang[:, 2:])

    #4 [金山文档] 环境支撑评分表（年）151910486.zip
    # FileCompanyAll = '企业数据库/CSMAR/环境支撑评分表（年）151910486/EDT_EnvEnablingScoringY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1, 3, 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19],
    #                                                                                   skiprows=[0, 1, 2])
    # # 交换第 0 列和第 1 列
    # dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 17)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3.xlsx', '企业信息合并/企业总表删链接-1-2-3-4.xlsx', 60,
    #                                 5, chuangXinDaoXiang[:, 2:])

 #5 [金山文档] 技术创新词频统计表（年）151043513(1).zip
 #    FileCompanyAll = '企业数据库/CSMAR/技术创新词频统计表（年）151043513/EDT_TechInnWordFreSta.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
 #    dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
 #                                                                                      usecols=[0, 1, 3],#, 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
 #                                                                                      skiprows=[0, 1, 2])
 #    # 交换第 0 列和第 1 列
 #    dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
 #    chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 1)
 #
 #    CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4.xlsx', '企业信息合并/企业总表删链接-1-2-3-4-5.xlsx', 77,
 #                                    5, chuangXinDaoXiang[:, 2:])

    # #6 [金山文档] 技术驱动评分表（年）151358435.zip
    # FileCompanyAll = '企业数据库/CSMAR/技术驱动评分表（年）151358435/EDT_TechEnablingScoringY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1, 3, 4, 5,6, 7],
    #                                                                                   # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
    #                                                                                   skiprows=[0, 1, 2])
    # # 交换第 0 列和第 1 列
    # dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 5)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-5.xlsx',
    #                                 '企业信息合并/企业总表删链接-1-2-3-4-6.xlsx', 78,
    #                                 5, chuangXinDaoXiang[:, 2:])


 #7 [金山文档] 科技创新基地建设情况表（年）145946455.zip
 #    FileCompanyAll = '企业数据库/CSMAR/科技创新基地建设情况表（年）145946455/EDT_SciTechInnBaseConsStu.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
 #    dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
 #                                                                                      usecols=[0, 1, 3],
 #                                                                                      # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
 #                                                                                      skiprows=[0, 1, 2])
 #    # 交换第 0 列和第 1 列
 #    dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
 #    chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 1)
 #
 #    CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6.xlsx',
 #                                    '企业信息合并/企业总表删链接-1-2-3-4-6-7.xlsx', 83,
 #                                    5, chuangXinDaoXiang[:, 2:])


#8 [金山文档] 企业数字化转型指数统计表（年）152036719.zip
#     FileCompanyAll = '企业数据库/CSMAR/企业数字化转型指数统计表（年）152036719/EDT_DigTransIndexStaY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
#     dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
#                                                                                       usecols=[0, 1, 15,16,17,18,19,20,21],
#                                                                                       # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
#                                                                                       skiprows=[0, 1, 2])
#     # 交换第 0 列和第 1 列
#     dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
#     chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 7)
#
#     CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7.xlsx',
#                                     '企业信息合并/企业总表删链接-1-2-3-4-6-7-8.xlsx', 87,
#                                     5, chuangXinDaoXiang[:, 2:])

    #9 [金山文档] 数字创新标准工作统计表（年）150627103.zip
    # FileCompanyAll = '企业数据库/CSMAR/数字创新标准工作统计表（年）150627103/EDT_DigInnStanY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1, 3,4],
    #                                                                                   # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
    #                                                                                   skiprows=[0, 1, 2])
    # # 交换第 0 列和第 1 列
    # dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 2)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7-8.xlsx',
    #                                 '企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9.xlsx', 94,
    #                                 5, chuangXinDaoXiang[:, 2:])

    #10 [金山文档] 数字创新论文数量统计表（年）150710893.zip
    # FileCompanyAll = '企业数据库/CSMAR/数字创新论文数量统计表（年）150710893/EDT_DigInnThesY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1, 3,4],
    #                                                                                   # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
    #                                                                                   skiprows=[0, 1, 2])
    # # 交换第 0 列和第 1 列
    # dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 2)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9.xlsx',
    #                                 '企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10.xlsx', 96,
    #                                 5, chuangXinDaoXiang[:, 2:])


 # 11 [金山文档] 数字创新资质统计表（年）150813621.zip
 #    FileCompanyAll = '企业数据库/CSMAR/数字创新资质统计表（年）150813621/EDT_DigInnQualY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
 #    dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
 #                                                                                      usecols=[0, 1, 3,4],
 #                                                                                      # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
 #                                                                                      skiprows=[0, 1, 2])
 #    # 交换第 0 列和第 1 列
 #    dataFileCompanyAll[:, [0, 1]] = dataFileCompanyAll[:, [1, 0]]
 #    chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 2)
 #
 #    CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10.xlsx',
 #                                    '企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11.xlsx', 98,
 #                                    5, chuangXinDaoXiang[:, 2:])


# 12 [金山文档] 数字发明专利授权情况表（年）150739381.zip
#     FileCompanyAll = '企业数据库/CSMAR/数字发明专利授权情况表（年）150739381/EDT_DigInvPatAutY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
#     dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
#                                                                                       usecols=[0, 1, 3],
#                                                                                       # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
#                                                                                       skiprows=[0, 1, 2])
#
#     chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 1)
#
#     CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11.xlsx',
#                                     '企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12.xlsx', 100,
#                                     5, chuangXinDaoXiang[:, 2:])

#13 [金山文档] 数字化成果评分表（年）151931847.zip
    # FileCompanyAll = '企业数据库/CSMAR/数字化成果评分表（年）151931847/EDT_DigAchScoringY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1,6, 7, 8, 9, 10],
    #                                                                                   # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
    #                                                                                   skiprows=[0, 1, 2])
    #
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 5)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12.xlsx',
    #                                 '企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12-13.xlsx', 101,
    #                                 5, chuangXinDaoXiang[:, 2:])


#14 [金山文档] 数字化应用评分表（年）152001257.zip
    # FileCompanyAll = '企业数据库/CSMAR/数字化应用评分表（年）152001257/EDT_DigAppScoringY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1,3, 4, 5,6],
    #                                                                                   # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
    #                                                                                   skiprows=[0, 1, 2])
    #
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 4)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12-13.xlsx',
    #                                 '企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12-13-14.xlsx', 106,
    #                                 5, chuangXinDaoXiang[:, 2:])

#15 [金山文档] 数字资本投入计划统计表（年）145717132.zip
    # FileCompanyAll = '企业数据库/CSMAR/数字资本投入计划统计表（年）145717132/EDT_DigCapInvPlanY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1,3,4],
    #                                                                                   # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
    #                                                                                   skiprows=[0, 1, 2])
    #
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 2)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12-13-14-15-16.xlsx',
    #                                 '企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12-13-14-15-16-15.xlsx', 110,
    #                                 5, chuangXinDaoXiang[:, 2:])


#16 [金山文档] 组织赋能评分表（年）151459666.zip
    # FileCompanyAll = '企业数据库/CSMAR/组织赋能评分表（年）151459666/EDT_OrgEnablingScoringY.xlsx'  # 文件夹路径，替换为你的实际文件夹路径
    # dataFileCompany, dataFileCompanyAll = CompanyInforCat.Read_data_ChuangXinDaoXiang(FileCompanyAll,
    #                                                                                   usecols=[0, 1, 7, 8, 9],
    #                                                                                   # , 4, 5,6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16,17,18,19
    #                                                                                   skiprows=[0, 1, 2])
    #
    # chuangXinDaoXiang = CompanyInforCat.Match(dataFileCompany, dataFileCompanyAll, 3)
    #
    # CompanyInforCat.write_to_matrix('企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12-13-14-15.xlsx',
    #                                 '企业信息合并/企业总表删链接-1-2-3-4-6-7-8-9-10-11-12-13-14-15-16.xlsx', 112,
    #                                 5, chuangXinDaoXiang[:, 2:])









